package com.cqc.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.cqc.manage.entity.CostStatistics;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;


public interface CostStatisticsMapper extends BaseMapper<CostStatistics> {


    /**
     * 查询每个公司的业务量，选取前20行
     */

    @Select("select DISTINCT client as name,sum(agreement_amount) as value from cost_statistics where start_date > '2021' GROUP BY client ORDER BY sum(agreement_amount) DESC limit 10")
    List<Map<String,Integer>> selectCompanyAgreementAmount();


}
